As the number of write/erase (W/E) (a.k.a. program/erase (P/E)) cycles performed in a flash memory increases, data retention capability of the flash memory is reduced and the probability of failures is increased. Such failures are usually related to wearing of an oxide isolation layer of cells in the flash memory due to electrons passing through the oxide isolation layer during W/E cycles and generating electron trap sites. Such failures can be manifested in several ways, such as by failing to erase or program a block of cells in the flash memory or by having reduced cell data retention (i.e., a reduced ability to store data reliably for a certain period of time). As cell dimensions shrink, a corresponding reduction in endurance may become a limiting factor affecting commercial viability of non-volatile memories, such as NAND-based flash memory.
Data with a distribution that is different (e.g., significantly different) than a distribution induced by an independent and identically distributed (i.i.d.) bit source having equal probability for 1 and 0 may be said to be “shaped.” Examples of shaped data include data that contains a higher number of 1-s than 0-s, or vice versa (e.g., data which contains a higher number of 0-s than 1-s). An amount of shaping may correspond to entropy of a data source that is determined relative to an alphabet of data and its distribution. For example, binary entropy is the entropy of an i.i.d. data source having an alphabet {0, 1}. Binary entropy can be determined as H(p)=−p(0)log2 p(0)−p(1)log2 p(1), where p(0) is the probability that the data source will generate the value 0 and p(1) is the probability that the data source will generate the value 1. If the data source has a distribution of 90% 0-s and 10% 1-s, the entropy H(p) is approximately equal to 0.47. As another example, if an i.i.d. data source has an alphabet that contains four symbols {A, B, C, D}, the entropy of the data source can be determined as H(p)=−p(A)log2 p(A)−p(B)log2 p(B)−p(C)log2 p(C)−p(D)log2 p(D). If A, B, C, and D are represented in the data by the ordered pairs (0,0), (0,1), (1,0), and (1,1), respectively, low entropy but equal probability of states A and D may result, such as when p(0,0)=p(1,1)=0.05 and p(1,0)=p(0,1)=0.45.
Any data that includes a logical page of data having entropy lower (e.g., significantly lower) than one (where one is the binary entropy of data having 50% zeros and 50% ones) can be considered to be shaped. Criteria for considering a value of entropy to be significantly lower than ‘1’ may vary according to each particular implementation. In some examples, shaped data may have a higher number of 1-s because in conventional NAND flash systems, ‘1’ typically represents an erase (“ER”) state while ‘0’ typically represents a programmed state. Shaping data to have a higher number of 1-s may increase a useful life of a flash memory because increasing the proportion of memory cells that are set to the erase state (i.e., cells set to logical ‘1”) causes less wear of the flash cells and increases the number of W/E cycles that the NAND flash cells may undergo while maintaining a pre-defined storage reliability.
In many cases, wearing of the cells of a non-volatile memory (NVM) may be the factor that limits the useful life of a flash memory system. Various methods may be used to shape compressible data to form shaped data, such that the portion of 1-s in the shaped data is larger than the portion of 0-s. Because ‘1’ typically corresponds to the Erase state in a NVM, the NVM partition may experience less wear when programmed with shaped data. Thus, shaping the data stored in the NVM may reduce wear, thereby increasing an endurance of the NVM. Additionally, shaping the data may reduce an average bit error rate (BER). However, shaping data may increase a variance (e.g., a maximum or instantaneous value) of the BER due to potentially problematic combinations of shaped data.